<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html lang="en" class="no-js">

<head>
<meta http-equiv="content-type" content="text/html" charset="utf-8" />
<title>添加发布内容</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/admin/qf/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/admin/qf/css/add.css" />
</head>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/admin/qf/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/admin/qf/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</head>
<script type="text/javascript">
	$(function() {
		fun();
		addupdate();
	});

	function fun() {
		$.ajax({
			dataType : "json",
			type : "post",
			url : "${pageContext.request.contextPath }/findPosit",
			dataType : 'json',
			success : function(msg) {
				var len = msg.length;
				for (var i = 0; i <= len; i++) {

					$("#select").append(
							"<option value='"+msg[i].positId+"'>"
									+ msg[i].positName + "</option>");

				}

			}
		});
	}

	//判断form表单是添加还是修改
	var addupdate = function() {
		if ($("#rid").val() == null || $("#rid").val() == "") {
			$("#div1").css('display', 'none');
			$("form").attr('action',
					'${pageContext.request.contextPath }/addRecruit')
		} else {
			$("#div1").css('display', 'block');
			$("form").attr('action',
					'${pageContext.request.contextPath }/updaetRecruit?recruitId='+$("#rid").val())
		}
	}
</script>

<body>
	<hr>
	<b>&nbsp;&nbsp;新增发布内容</b>
	<hr>
	<form action="${pageContext.request.contextPath }/addRecruit" method="post">
		<div class="add">
			<div id="div1">
			职位编号：<input type="text" id="rid"
						value="${model.recruitId}" name="recruitId" disabled="disabled" class="tt" /></div>
			<table style="border-collapse: separate; border-spacing: 0px 20px;">
			
				<tr align="right">
					<td>职位名称：</td>
					<td align="left"><select id="select" name="posit.positId"><option
								value="">--请选择职位--</option></select></td>
				</tr>
				<tr align="right">
					<td>岗位职责：</td>
					<td align="left"><textarea rows="4" name="recruitYq"
							cols="50">${model.recruitYq}</textarea></td>
				</tr>
				<tr align="right">
					<td>职位要求：</td>
					<td align="left"><textarea rows="4" name="recruitMent"
							cols="50">${model.recruitMent}</textarea></td>
				</tr>
				<tr align="right">
					<td>招聘数量：</td>
					<td align="left"><input type="text"
						value="${model.recruitNum}" name="recruitNum" class="tt" /></td>
				</tr>
				<tr align="right">
					<td>开始时间：</td>
					<td align="left"><input name="recruitBtime"
						value="${model.recruitBtime}" class="tt" type="date" /></td>
				</tr>
				
				<tr>
					<td></td>
					<td align="left"><input type="submit" class="btn btn-primary"
						style="width: 100px; height: 40px;" value=" 提  交 " /><br></td>
				</tr>
			</table>
		</div>
	</form>
</body>

</html>